package com.wicket.okrpbff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrpbff.biz.service.TargetCycleService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrapp.integration.FwAppTargetCycleClient;
import com.wicket.okrapp.integration.dto.QueryMidBasicCheckTargetDutyListRespDto;
import com.wicket.okrapp.integration.dto.QueryMidBasicCheckTargetDutyListReqDto;
import com.wicket.okrapp.integration.dto.BatchQueryEvaObjTargetCycleOsetComRespDto;
import com.wicket.okrapp.integration.dto.BatchQueryEvaObjTargetCycleOsetComReqDto;
import com.wicket.okrpbff.common.dto.TreeNode;
import java.util.stream.Collectors;
import com.wicket.okrpbff.common.exception.Assert;
import com.wicket.okrpbff.common.util.CommonFunctionHelper;
import com.wicket.okrpbff.biz.service.dto.common.BffMidBasicCheckTargetDutyDto;
import com.wicket.okrpbff.biz.service.dto.common.BffCheckEvaObjTargetCycleOsetDto;
import com.wicket.okrapp.integration.dto.QueryFormHorizontalTargetPeriodListComRespDto;
import com.wicket.okrapp.integration.dto.QueryFormHorizontalTargetPeriodListComReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffFormHorizontalTargetPeriodDto;
import com.wicket.okrapp.integration.dto.RefreshExecuteCycleStageTimingRuleComRespDto;
import com.wicket.okrapp.integration.dto.RefreshExecuteCycleStageTimingRuleComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "TargetCycle", tags = { "TargetCycle" })
@RestController
// @RequestMapping("/poms/targetCycle/")
public class TargetCycleController {

  @Autowired
  TargetCycleService targetCycleService;
/**
   * B3批量查询中基层校验观测点(管理)
   * gen by moon at 11/7/2022, 12:25:34 AM
   */
    @PostMapping("/oms/mgt/targetCycle/batchQueryMidBasicCheckTarget")
    @ApiOperation(value = "B3批量查询中基层校验观测点(管理)", response = OkrResult.class)
    public OkrResult<BffBatchQueryMidBasicCheckTargetRespDto> batchQueryMidBasicCheckTarget(@RequestBody(required=false) @Validated BffBatchQueryMidBasicCheckTargetReqDto reqDTO){
        return OkrResult.success(targetCycleService.batchQueryMidBasicCheckTarget(reqDTO));
    }
/**
   * B3查询表格横向目标周期列表(管理)
   * gen by moon at 11/7/2022, 12:25:35 AM
   */
    @PostMapping("/oms/mgt/targetCycle/queryFormHorizontalTargetPeriodList")
    @ApiOperation(value = "B3查询表格横向目标周期列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryFormHorizontalTargetPeriodListRespDto> queryFormHorizontalTargetPeriodList(@RequestBody(required=false) @Validated BffQueryFormHorizontalTargetPeriodListReqDto reqDTO){
        return OkrResult.success(targetCycleService.queryFormHorizontalTargetPeriodList(reqDTO));
    }
/**
   * B3-更新执行周期阶段时段规则
   * gen by moon at 12/29/2022, 12:58:50 PM
   */
    @PostMapping("/oms/targetCycle/refreshExecuteCycleStageTimingRule")
    @ApiOperation(value = "B3-更新执行周期阶段时段规则", response = OkrResult.class)
    public OkrResult<BffRefreshExecuteCycleStageTimingRuleRespDto> refreshExecuteCycleStageTimingRule(@RequestBody(required=false) @Validated BffRefreshExecuteCycleStageTimingRuleReqDto reqDTO){
        return OkrResult.success(targetCycleService.refreshExecuteCycleStageTimingRule(reqDTO));
    }
}
